package com.jsgt.greekfire.ui.gfc

import android.app.Dialog
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.lifecycle.ViewModelProvider
import androidx.viewpager.widget.ViewPager
import com.fhx.core.base.BaseActivity
import com.fhx.core.base.BaseFragment
import com.google.android.material.tabs.TabLayout
import com.jsgt.greekfire.R
import com.jsgt.greekfire.factory.CoinGFCModelFactory
import com.jsgt.greekfire.ui.trading.adapter.PagerAdapter
import com.jsgt.greekfire.viewmodel.CoinCurrencyViewModel
import kotlinx.android.synthetic.main.activity_binding_payment_setting.*
import kotlinx.android.synthetic.main.activity_commission.*

class CommissionActivity : BaseActivity() {
    private val fragments: MutableList<BaseFragment> = ArrayList()
    private var coinFragment: CommissionFragment? = null
    var tvTitle: TextView? = null

    override fun getLayoutId(): Int = R.layout.activity_commission

    override fun main() {

        initTab()
        tvTitle = findViewById(R.id.title_tv)
        tvTitle?.text = "订单"
    }
    private fun initTab() {
        var item = resources.getStringArray(R.array.historical_orders_list1)
        val tabs = java.util.ArrayList<String>()
        for (i in item.indices) {
            tabs.add(item[i])
            coinFragment = CommissionFragment.newInstance(item[i])
            fragments.add(coinFragment!!)
        }
/*
        tabCommission.tabMode = TabLayout.MODE_FIXED
        tabCommission.setupWithViewPager(vpCommission)
        vpCommission.adapter = PagerAdapter(
            supportFragmentManager,
            fragments,
            tabs
        )
        vpCommission.currentItem = 0
        vpCommission.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
            override fun onPageScrollStateChanged(state: Int) {
            }

            override fun onPageScrolled(
                position: Int,
                positionOffset: Float,
                positionOffsetPixels: Int
            ) {
            }

            override fun onPageSelected(position: Int) {
            }
        })*/

    }
}